package com.xzkydz.all_sensor.fragment;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.xzkydz.all_sensor.activity.MainActivity;
import com.xzkydz.all_sensor.allsensor.R;

/**
 * Created by Smilekun on 2016/8/26.
 */
public class PressFragment extends Fragment {

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View  view  =  inflater.inflate(R.layout.fragment_press, container, false);
        final MainActivity mActivity  = (MainActivity)getActivity();
        Button  button_lingdain  =  (Button)view.findViewById(R.id.btn_lingdian);
        Button  button_manLiangcheng = (Button)view.findViewById(R.id.btn_manliangcheng);



        button_lingdain.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801050001400102004E");
            }
        });


        button_manLiangcheng.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801050001400103004F");
            }
        });
        return   view ;
    }
}
